/*!
 * @file gfxParticles.cpp
 * @brief Ciało gfxParticles.hh
 */

#include "engine/gfx/gfxParticles.hh"
using namespace std;

/*--------------------------------------------------------------------------*/

gfxParticles::gfxParticles() {

}

/*--------------------------------------------------------------------------*/

void gfxParticles::addParticle(particle *p) {

	this->particleStack.push_back(p);

}

/*--------------------------------------------------------------------------*/

void gfxParticles::removeParticle(particle *p) {

	for (list<particle*>::iterator i = this->particleStack.begin(); i
			!= this->particleStack.end(); i++) {

		if ((*i) == p) {
			this->particleStack.erase(i);
			break;
		}
	}

}

/*--------------------------------------------------------------------------*/

void gfxParticles::calculate() {

	for (list<particle*>::iterator i = this->particleStack.begin(); i
			!= this->particleStack.end(); i++) {
		(*i)->calculate();
	}

}
/*--------------------------------------------------------------------------*/

void gfxParticles::draw() {

	for (list<particle*>::iterator i = this->particleStack.begin(); i
			!= this->particleStack.end(); i++) {
		(*i)->paint();
	}

}
/*--------------------------------------------------------------------------*/
